<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  Data.Functor</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2001</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- A type @f@ is a Functor if it provides a function @fmap@ which, given any types @a@ and @b@,</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- lets you apply any function of type @(a -&gt; b)@ to turn an @f a@ into an @f b@, preserving the</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- structure of @f@.</span><span>
</span><span id="line-18"></span><span class="hs-comment">--</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- ==== __Examples__</span><span>
</span><span id="line-20"></span><span class="hs-comment">--</span><span>
</span><span id="line-21"></span><span class="hs-comment">--  &gt;&gt;&gt; fmap show (Just 1)  --  (a   -&gt; b)      -&gt; f a       -&gt; f b</span><span>
</span><span id="line-22"></span><span class="hs-comment">--  Just &quot;1&quot;                --  (Int -&gt; String) -&gt; Maybe Int -&gt; Maybe String</span><span>
</span><span id="line-23"></span><span class="hs-comment">--</span><span>
</span><span id="line-24"></span><span class="hs-comment">--  &gt;&gt;&gt; fmap show Nothing   --  (a   -&gt; b)      -&gt; f a       -&gt; f b</span><span>
</span><span id="line-25"></span><span class="hs-comment">--  Nothing                 --  (Int -&gt; String) -&gt; Maybe Int -&gt; Maybe String</span><span>
</span><span id="line-26"></span><span class="hs-comment">--</span><span>
</span><span id="line-27"></span><span class="hs-comment">--  &gt;&gt;&gt; fmap show [1,2,3]   --  (a   -&gt; b)      -&gt; f a       -&gt; f b</span><span>
</span><span id="line-28"></span><span class="hs-comment">--  [&quot;1&quot;,&quot;2&quot;,&quot;3&quot;]           --  (Int -&gt; String) -&gt; [Int]     -&gt; [String]</span><span>
</span><span id="line-29"></span><span class="hs-comment">--</span><span>
</span><span id="line-30"></span><span class="hs-comment">--  &gt;&gt;&gt; fmap show []        --  (a   -&gt; b)      -&gt; f a       -&gt; f b</span><span>
</span><span id="line-31"></span><span class="hs-comment">--  []                      --  (Int -&gt; String) -&gt; [Int]     -&gt; [String]</span><span>
</span><span id="line-32"></span><span class="hs-comment">--</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- The 'fmap' function is also available as the infix operator '&lt;$&gt;':</span><span>
</span><span id="line-34"></span><span class="hs-comment">--</span><span>
</span><span id="line-35"></span><span class="hs-comment">--  &gt;&gt;&gt; fmap show (Just 1) --  (Int -&gt; String) -&gt; Maybe Int -&gt; Maybe String</span><span>
</span><span id="line-36"></span><span class="hs-comment">--  Just &quot;1&quot;</span><span>
</span><span id="line-37"></span><span class="hs-comment">--  &gt;&gt;&gt; show &lt;$&gt; (Just 1)  --  (Int -&gt; String) -&gt; Maybe Int -&gt; Maybe String</span><span>
</span><span id="line-38"></span><span class="hs-comment">--  Just &quot;1&quot;</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Data.Functor</span><span>
</span><span id="line-41"></span><span>    </span><span class="hs-special">(</span><span>
</span><span id="line-42"></span><span>      </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier">Functor</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>      </span><span class="annot"><a href="Data.Functor.html#%24%3E"><span class="hs-operator">($&gt;)</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>      </span><span class="annot"><a href="Data.Functor.html#%3C%24%3E"><span class="hs-operator">(&lt;$&gt;)</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>      </span><span class="annot"><a href="Data.Functor.html#%3C%26%3E"><span class="hs-operator">(&lt;&amp;&gt;)</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>      </span><span class="annot"><a href="Data.Functor.html#void"><span class="hs-identifier">void</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier">Functor</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Base.html#flip"><span class="hs-identifier">flip</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-comment">-- $setup</span><span>
</span><span id="line-52"></span><span class="hs-comment">-- Allow the use of Prelude in doctests.</span><span>
</span><span id="line-53"></span><span class="hs-comment">-- &gt;&gt;&gt; import Prelude hiding ((&lt;$&gt;))</span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">4</span><span> </span><span class="annot"><a href="Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-type">&lt;$&gt;</span></a></span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-comment">-- | An infix synonym for 'fmap'.</span><span>
</span><span id="line-58"></span><span class="hs-comment">--</span><span>
</span><span id="line-59"></span><span class="hs-comment">-- The name of this operator is an allusion to 'Prelude.$'.</span><span>
</span><span id="line-60"></span><span class="hs-comment">-- Note the similarities between their types:</span><span>
</span><span id="line-61"></span><span class="hs-comment">--</span><span>
</span><span id="line-62"></span><span class="hs-comment">-- &gt;  ($)  ::              (a -&gt; b) -&gt;   a -&gt;   b</span><span>
</span><span id="line-63"></span><span class="hs-comment">-- &gt; (&lt;$&gt;) :: Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b</span><span>
</span><span id="line-64"></span><span class="hs-comment">--</span><span>
</span><span id="line-65"></span><span class="hs-comment">-- Whereas 'Prelude.$' is function application, '&lt;$&gt;' is function</span><span>
</span><span id="line-66"></span><span class="hs-comment">-- application lifted over a 'Functor'.</span><span>
</span><span id="line-67"></span><span class="hs-comment">--</span><span>
</span><span id="line-68"></span><span class="hs-comment">-- ==== __Examples__</span><span>
</span><span id="line-69"></span><span class="hs-comment">--</span><span>
</span><span id="line-70"></span><span class="hs-comment">-- Convert from a @'Data.Maybe.Maybe' 'Data.Int.Int'@ to a @'Data.Maybe.Maybe'</span><span>
</span><span id="line-71"></span><span class="hs-comment">-- 'Data.String.String'@ using 'Prelude.show':</span><span>
</span><span id="line-72"></span><span class="hs-comment">--</span><span>
</span><span id="line-73"></span><span class="hs-comment">-- &gt;&gt;&gt; show &lt;$&gt; Nothing</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- Nothing</span><span>
</span><span id="line-75"></span><span class="hs-comment">-- &gt;&gt;&gt; show &lt;$&gt; Just 3</span><span>
</span><span id="line-76"></span><span class="hs-comment">-- Just &quot;3&quot;</span><span>
</span><span id="line-77"></span><span class="hs-comment">--</span><span>
</span><span id="line-78"></span><span class="hs-comment">-- Convert from an @'Data.Either.Either' 'Data.Int.Int' 'Data.Int.Int'@ to an</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- @'Data.Either.Either' 'Data.Int.Int'@ 'Data.String.String' using 'Prelude.show':</span><span>
</span><span id="line-80"></span><span class="hs-comment">--</span><span>
</span><span id="line-81"></span><span class="hs-comment">-- &gt;&gt;&gt; show &lt;$&gt; Left 17</span><span>
</span><span id="line-82"></span><span class="hs-comment">-- Left 17</span><span>
</span><span id="line-83"></span><span class="hs-comment">-- &gt;&gt;&gt; show &lt;$&gt; Right 17</span><span>
</span><span id="line-84"></span><span class="hs-comment">-- Right &quot;17&quot;</span><span>
</span><span id="line-85"></span><span class="hs-comment">--</span><span>
</span><span id="line-86"></span><span class="hs-comment">-- Double each element of a list:</span><span>
</span><span id="line-87"></span><span class="hs-comment">--</span><span>
</span><span id="line-88"></span><span class="hs-comment">-- &gt;&gt;&gt; (*2) &lt;$&gt; [1,2,3]</span><span>
</span><span id="line-89"></span><span class="hs-comment">-- [2,4,6]</span><span>
</span><span id="line-90"></span><span class="hs-comment">--</span><span>
</span><span id="line-91"></span><span class="hs-comment">-- Apply 'Prelude.even' to the second element of a pair:</span><span>
</span><span id="line-92"></span><span class="hs-comment">--</span><span>
</span><span id="line-93"></span><span class="hs-comment">-- &gt;&gt;&gt; even &lt;$&gt; (2,2)</span><span>
</span><span id="line-94"></span><span class="hs-comment">-- (2,True)</span><span>
</span><span id="line-95"></span><span class="hs-comment">--</span><span>
</span><span id="line-96"></span><span id="local-6989586621679541588"><span id="local-6989586621679541589"><span id="local-6989586621679541590"><span class="annot"><a href="Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-type">(&lt;$&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541590"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679541589"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541588"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541590"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541589"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541590"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541588"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-97"></span><span id="%3C%24%3E"><span class="annot"><span class="annottext">&lt;$&gt; :: forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var hs-var">(&lt;$&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; f a -&gt; f b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">4</span><span> </span><span class="annot"><a href="Data.Functor.html#%24%3E"><span class="hs-operator hs-type">$&gt;</span></a></span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span class="hs-comment">-- | Flipped version of '&lt;$&gt;'.</span><span>
</span><span id="line-102"></span><span class="hs-comment">--</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-104"></span><span class="hs-comment">-- ('&lt;&amp;&gt;') = 'flip' 'fmap'</span><span>
</span><span id="line-105"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-106"></span><span class="hs-comment">--</span><span>
</span><span id="line-107"></span><span class="hs-comment">-- @since 4.11.0.0</span><span>
</span><span id="line-108"></span><span class="hs-comment">--</span><span>
</span><span id="line-109"></span><span class="hs-comment">-- ==== __Examples__</span><span>
</span><span id="line-110"></span><span class="hs-comment">-- Apply @(+1)@ to a list, a 'Data.Maybe.Just' and a 'Data.Either.Right':</span><span>
</span><span id="line-111"></span><span class="hs-comment">--</span><span>
</span><span id="line-112"></span><span class="hs-comment">-- &gt;&gt;&gt; Just 2 &lt;&amp;&gt; (+1)</span><span>
</span><span id="line-113"></span><span class="hs-comment">-- Just 3</span><span>
</span><span id="line-114"></span><span class="hs-comment">--</span><span>
</span><span id="line-115"></span><span class="hs-comment">-- &gt;&gt;&gt; [1,2,3] &lt;&amp;&gt; (+1)</span><span>
</span><span id="line-116"></span><span class="hs-comment">-- [2,3,4]</span><span>
</span><span id="line-117"></span><span class="hs-comment">--</span><span>
</span><span id="line-118"></span><span class="hs-comment">-- &gt;&gt;&gt; Right 3 &lt;&amp;&gt; (+1)</span><span>
</span><span id="line-119"></span><span class="hs-comment">-- Right 4</span><span>
</span><span id="line-120"></span><span class="hs-comment">--</span><span>
</span><span id="line-121"></span><span id="local-6989586621679541579"><span id="local-6989586621679541580"><span id="local-6989586621679541581"><span class="annot"><a href="Data.Functor.html#%3C%26%3E"><span class="hs-operator hs-type">(&lt;&amp;&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541581"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541581"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541580"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679541580"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541579"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541581"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541579"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-122"></span><span id="local-6989586621679541551"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679541551"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span id="%3C%26%3E"><span class="annot"><span class="annottext">&lt;&amp;&gt; :: forall (f :: * -&gt; *) a b. Functor f =&gt; f a -&gt; (a -&gt; b) -&gt; f b
</span><a href="Data.Functor.html#%3C%26%3E"><span class="hs-operator hs-var hs-var">&lt;&amp;&gt;</span></a></span></span><span> </span><span id="local-6989586621679541550"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679541550"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679541550"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; f a -&gt; f b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679541551"><span class="hs-keyword hs-var">as</span></a></span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">1</span><span> </span><span class="annot"><a href="Data.Functor.html#%3C%26%3E"><span class="hs-operator hs-type">&lt;&amp;&gt;</span></a></span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span class="hs-comment">-- | Flipped version of '&lt;$'.</span><span>
</span><span id="line-127"></span><span class="hs-comment">--</span><span>
</span><span id="line-128"></span><span class="hs-comment">-- @since 4.7.0.0</span><span>
</span><span id="line-129"></span><span class="hs-comment">--</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- ==== __Examples__</span><span>
</span><span id="line-131"></span><span class="hs-comment">--</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- Replace the contents of a @'Data.Maybe.Maybe' 'Data.Int.Int'@ with a constant</span><span>
</span><span id="line-133"></span><span class="hs-comment">-- 'Data.String.String':</span><span>
</span><span id="line-134"></span><span class="hs-comment">--</span><span>
</span><span id="line-135"></span><span class="hs-comment">-- &gt;&gt;&gt; Nothing $&gt; &quot;foo&quot;</span><span>
</span><span id="line-136"></span><span class="hs-comment">-- Nothing</span><span>
</span><span id="line-137"></span><span class="hs-comment">-- &gt;&gt;&gt; Just 90210 $&gt; &quot;foo&quot;</span><span>
</span><span id="line-138"></span><span class="hs-comment">-- Just &quot;foo&quot;</span><span>
</span><span id="line-139"></span><span class="hs-comment">--</span><span>
</span><span id="line-140"></span><span class="hs-comment">-- Replace the contents of an @'Data.Either.Either' 'Data.Int.Int' 'Data.Int.Int'@</span><span>
</span><span id="line-141"></span><span class="hs-comment">-- with a constant 'Data.String.String', resulting in an @'Data.Either.Either'</span><span>
</span><span id="line-142"></span><span class="hs-comment">-- 'Data.Int.Int' 'Data.String.String'@:</span><span>
</span><span id="line-143"></span><span class="hs-comment">--</span><span>
</span><span id="line-144"></span><span class="hs-comment">-- &gt;&gt;&gt; Left 8675309 $&gt; &quot;foo&quot;</span><span>
</span><span id="line-145"></span><span class="hs-comment">-- Left 8675309</span><span>
</span><span id="line-146"></span><span class="hs-comment">-- &gt;&gt;&gt; Right 8675309 $&gt; &quot;foo&quot;</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- Right &quot;foo&quot;</span><span>
</span><span id="line-148"></span><span class="hs-comment">--</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- Replace each element of a list with a constant 'Data.String.String':</span><span>
</span><span id="line-150"></span><span class="hs-comment">--</span><span>
</span><span id="line-151"></span><span class="hs-comment">-- &gt;&gt;&gt; [1,2,3] $&gt; &quot;foo&quot;</span><span>
</span><span id="line-152"></span><span class="hs-comment">-- [&quot;foo&quot;,&quot;foo&quot;,&quot;foo&quot;]</span><span>
</span><span id="line-153"></span><span class="hs-comment">--</span><span>
</span><span id="line-154"></span><span class="hs-comment">-- Replace the second element of a pair with a constant 'Data.String.String':</span><span>
</span><span id="line-155"></span><span class="hs-comment">--</span><span>
</span><span id="line-156"></span><span class="hs-comment">-- &gt;&gt;&gt; (1,2) $&gt; &quot;foo&quot;</span><span>
</span><span id="line-157"></span><span class="hs-comment">-- (1,&quot;foo&quot;)</span><span>
</span><span id="line-158"></span><span class="hs-comment">--</span><span>
</span><span id="line-159"></span><span id="local-6989586621679541573"><span id="local-6989586621679541574"><span id="local-6989586621679541575"><span class="annot"><a href="Data.Functor.html#%24%3E"><span class="hs-operator hs-type">($&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541575"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541575"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541574"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541573"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541575"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541573"><span class="hs-identifier hs-type">b</span></a></span></span></span></span><span>
</span><span id="line-160"></span><span id="%24%3E"><span class="annot"><span class="annottext">$&gt; :: forall (f :: * -&gt; *) a b. Functor f =&gt; f a -&gt; b -&gt; f b
</span><a href="Data.Functor.html#%24%3E"><span class="hs-operator hs-var hs-var">($&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(b -&gt; f a -&gt; f b) -&gt; f a -&gt; b -&gt; f b
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; f a -&gt; f b
forall (f :: * -&gt; *) a b. Functor f =&gt; a -&gt; f b -&gt; f a
</span><a href="GHC.Base.html#%3C%24"><span class="hs-operator hs-var">(&lt;$)</span></a></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span class="hs-comment">-- | @'void' value@ discards or ignores the result of evaluation, such</span><span>
</span><span id="line-163"></span><span class="hs-comment">-- as the return value of an 'System.IO.IO' action.</span><span>
</span><span id="line-164"></span><span class="hs-comment">--</span><span>
</span><span id="line-165"></span><span class="hs-comment">-- ==== __Examples__</span><span>
</span><span id="line-166"></span><span class="hs-comment">--</span><span>
</span><span id="line-167"></span><span class="hs-comment">-- Replace the contents of a @'Data.Maybe.Maybe' 'Data.Int.Int'@ with unit:</span><span>
</span><span id="line-168"></span><span class="hs-comment">--</span><span>
</span><span id="line-169"></span><span class="hs-comment">-- &gt;&gt;&gt; void Nothing</span><span>
</span><span id="line-170"></span><span class="hs-comment">-- Nothing</span><span>
</span><span id="line-171"></span><span class="hs-comment">-- &gt;&gt;&gt; void (Just 3)</span><span>
</span><span id="line-172"></span><span class="hs-comment">-- Just ()</span><span>
</span><span id="line-173"></span><span class="hs-comment">--</span><span>
</span><span id="line-174"></span><span class="hs-comment">-- Replace the contents of an @'Data.Either.Either' 'Data.Int.Int' 'Data.Int.Int'@</span><span>
</span><span id="line-175"></span><span class="hs-comment">-- with unit, resulting in an @'Data.Either.Either' 'Data.Int.Int' '()'@:</span><span>
</span><span id="line-176"></span><span class="hs-comment">--</span><span>
</span><span id="line-177"></span><span class="hs-comment">-- &gt;&gt;&gt; void (Left 8675309)</span><span>
</span><span id="line-178"></span><span class="hs-comment">-- Left 8675309</span><span>
</span><span id="line-179"></span><span class="hs-comment">-- &gt;&gt;&gt; void (Right 8675309)</span><span>
</span><span id="line-180"></span><span class="hs-comment">-- Right ()</span><span>
</span><span id="line-181"></span><span class="hs-comment">--</span><span>
</span><span id="line-182"></span><span class="hs-comment">-- Replace every element of a list with unit:</span><span>
</span><span id="line-183"></span><span class="hs-comment">--</span><span>
</span><span id="line-184"></span><span class="hs-comment">-- &gt;&gt;&gt; void [1,2,3]</span><span>
</span><span id="line-185"></span><span class="hs-comment">-- [(),(),()]</span><span>
</span><span id="line-186"></span><span class="hs-comment">--</span><span>
</span><span id="line-187"></span><span class="hs-comment">-- Replace the second element of a pair with unit:</span><span>
</span><span id="line-188"></span><span class="hs-comment">--</span><span>
</span><span id="line-189"></span><span class="hs-comment">-- &gt;&gt;&gt; void (1,2)</span><span>
</span><span id="line-190"></span><span class="hs-comment">-- (1,())</span><span>
</span><span id="line-191"></span><span class="hs-comment">--</span><span>
</span><span id="line-192"></span><span class="hs-comment">-- Discard the result of an 'System.IO.IO' action:</span><span>
</span><span id="line-193"></span><span class="hs-comment">--</span><span>
</span><span id="line-194"></span><span class="hs-comment">-- &gt;&gt;&gt; mapM print [1,2]</span><span>
</span><span id="line-195"></span><span class="hs-comment">-- 1</span><span>
</span><span id="line-196"></span><span class="hs-comment">-- 2</span><span>
</span><span id="line-197"></span><span class="hs-comment">-- [(),()]</span><span>
</span><span id="line-198"></span><span class="hs-comment">-- &gt;&gt;&gt; void $ mapM print [1,2]</span><span>
</span><span id="line-199"></span><span class="hs-comment">-- 1</span><span>
</span><span id="line-200"></span><span class="hs-comment">-- 2</span><span>
</span><span id="line-201"></span><span class="hs-comment">--</span><span>
</span><span id="line-202"></span><span id="local-6989586621679541563"><span id="local-6989586621679541564"><span class="annot"><a href="Data.Functor.html#void"><span class="hs-identifier hs-type">void</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541564"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541564"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679541563"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679541564"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span></span><span>
</span><span id="line-203"></span><span id="void"><span class="annot"><span class="annottext">void :: forall (f :: * -&gt; *) a. Functor f =&gt; f a -&gt; f ()
</span><a href="Data.Functor.html#void"><span class="hs-identifier hs-var hs-var">void</span></a></span></span><span> </span><span id="local-6989586621679541544"><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679541544"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">() -&gt; f a -&gt; f ()
forall (f :: * -&gt; *) a b. Functor f =&gt; a -&gt; f b -&gt; f a
</span><a href="GHC.Base.html#%3C%24"><span class="hs-operator hs-var">&lt;$</span></a></span><span> </span><span class="annot"><span class="annottext">f a
</span><a href="#local-6989586621679541544"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-204"></span></pre></body></html>